<template>
	<view class="main">
		<public-module></public-module>
<!-- 		<f-navbar title="个人中心" fontColor="#fff" :bgColor="PrimaryColor" :scrollTop="scrollTop" navbarType='5'
			:isShowLeft="false" :isShowTransparentTitle="false"></f-navbar> -->
		<view>
			<view style="height: 5px;"></view>
			<view style="margin: 5px;">
				<yt-order-list :orderList="orderList" @Transfer="Transfer" @jieOrder="jieOrder"
					@callUser="callUser"></yt-order-list>
			</view>
		</view>
		<f-tabbar></f-tabbar>
		
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import fTabbar from '@/components/module/f-tabbar/f-tabbar';
	import fNavbar from '@/components/module/f-navbar/f-navbar';
	
	// import request from '@/common/request.js';
	export default {
		components: {
			fNavbar,
			fTabbar
		},
		computed: {
			...mapState(['PrimaryColor', 'userInfo']),
			freeSpecsButtonBackground() {
				return this.$u.colorToRgba(this.$u.rgbToHex(this.PrimaryColor), 0.75)
			},
		},
		data() {
			return {
				    scrollTop: 0,// 定义scrollTop属性并赋初值

				orderList: [{
						orderId: '202404160001',
						title: '测试点位名称01',
						status: 3, //3:已完成 2:进行中 否则待接单
						cate: '主干扩容',
						name: '张师傅',
						time: '2024-4-16 18:00',
						km: '0.6km',
						mobile: '18638888888'
					},
					{
						orderId: '202404160002',
						title: '测试点位名称02',
						status: 1,
						cate: '分光器扩容',
						name: '李师傅',
						time: '2024-4-16 17:00',
						km: '0.6km',
						mobile: '18638888889'

					}
				],
			}
		},
		onLoad() {
			// 隐藏原生的tabbar
			uni.hideTabBar();
		},
		methods: {
			/**
			 * @method Transfer
			 * 订单转派
			 * @param {Object} id
			 */
			Transfer(e) {
				uni.navigateTo({
					url: '/pages/kwork/detail?status=' + e.status
				})
			},
			/**
			 * @method jieOrder
			 * 接单
			 * @param {Object} id
			 */
			jieOrder(id) {
				console.log("接单", id);
			},
			/**
			 * @method callUser
			 * 联系
			 * @param {Object} id
			 */
			callUser(id) {
				console.log("联系", id);
			}
		}
	}
</script>
<style lang="scss">
	// .main{
	// 	margin: 5px;
	// }
</style>